package com.isoftstone.disk.obs;

import java.io.*;

public class ReadFileMain {

    public static void main(String[] args) {
        try(
                //二进制读取
                FileInputStream fileInputStream = new FileInputStream("F:\\office\\goodLucky\\personnel.csv");
                //转换流，字符集
                InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream,"GBK");
                //当字集不需要转换时，可以直接使用FileReadery读
//                FileReader inputStreamReader = new FileReader("F:\\office\\goodLucky\\personnel.csv");
                //缓存流 按行读
                BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        ){
            String contents = "";
            while ((contents = bufferedReader.readLine()) != null){
                System.out.println(contents);
            }

        }catch (IOException e1){
            e1.printStackTrace();
        }

    }
}
